﻿using System;

namespace NodeJS
{
    [ImportClass("", "")]
    public class GlobalX
    {
        /// <summary>
        /// To schedule execution of a one-time callback after delay milliseconds. Returns a timeoutId for possible use with clearTimeout(). Optionally you can also pass arguments to the callback.
        /// It is important to note that your callback will probably not be called in exactly delay milliseconds - Node.js makes no guarantees about the exact timing of when the callback will fire, nor of the ordering things will fire in. The callback will be called as close as possible to the time specified.
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="delay"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public static Timer SetTimeout(Action callback, int delay, params object[] args)
        {
            return null;
        }

        /// <summary>
        /// Prevents a timeout from triggering.
        /// </summary>
        /// <param name="timeoutId"></param>
        public static void ClearTimeout(Timer timeoutId)
        {
        }

        /// <summary>
        /// To schedule the repeated execution of callback every delay milliseconds. Returns a intervalId for possible use with clearInterval(). Optionally you can also pass arguments to the callback.
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="delay"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public static Timer SetInterval(Action callback, int delay, params object[] args)
        {
            return null;
        }

        /// <summary>
        /// Stops a interval from triggering.
        /// </summary>
        /// <param name="intervalId"></param>
        public static void ClearInterval(Timer intervalId)
        {
        }        

        /// <summary>
        /// To schedule the "immediate" execution of callback after I/O events callbacks and before setTimeout and setInterval . Returns an immediateId for possible use with clearImmediate(). Optionally you can also pass arguments to the callback.
        /// Immediates are queued in the order created, and are popped off the queue once per loop iteration. This is different from process.nextTick which will execute process.maxTickDepth queued callbacks per iteration. 
        /// setImmediate will yield to the event loop after firing a queued callback to make sure I/O is not being starved. While order is preserved for execution, other I/O events may fire between any two scheduled immediate callbacks.
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public static Timer SetImmediate(Action callback, params object[] args)
        {
            return null;
        }

        /// <summary>
        /// Stops an immediate from triggering.
        /// </summary>
        /// <param name="immediateId"></param>
        public static void ClearImmediate(Timer immediateId)
        {
        }

        public static Process Process;

        [ImportMember("JSON")]
        public static IJSON JSON;
    }
}
